package com.cskaoyan.controller;

import com.cskaoyan.service.UserService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: libugu@cskaoyan.com
 * @date 2021/4/8 - 21:15
 */
@RestController
public class UserController {

   @Autowired
    UserService userService;

    @RequestMapping("admin/user/list")//page=1&limit=20&sort=add_time&order=desc
    public BaseRespVo list(Integer page, Integer limit, String sort, String order) {
        //page和limit 分页     👉 分页插件
        //sort和order 数据排序  👉 逆向工程生成的方法来做
        UserVo userVo = userService.query(page,limit,sort,order);
        return BaseRespVo.ok(userVo);
    }

//    @RequestMapping("admin/dashboard")
//    public BaseRespVo dashboard(){
//
//
//    }



}

